|
ARD2
1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
|
Serial Peripheral Interface drivers. More...
Functions | |
| uint8_t | u8fnDSPITranscieve (const uint8_t u8MyInstanceWCTAR, const uint8_t u8CSEnable, uint16_t *pu16DSPITx, uint16_t *pu16DSPIRx, const uint8_t u8Size) |
| This routine will, once the corresponding DSPI instance has been configured, send and receive any number of words through interrupts. Note that this means that at the exit of this routine, the message might still be ongoing. | |
| void | vfnDSPIEnable (const DSPIInstance_t tMyInstance, const uint8_t u8CSEnable, const uint8_t u8Start) |
| Enables or disables a particular DSPI transmission. used by u8fnDSPITranscieve. | |
| uint32_t | u32fnDSPIStatus (uint8_t u8Instance) |
| This routine returns the status register for a given instance. | |
| uint8_t | u8fnConfigDSPIGeneral (const DSPIConfig_t *tDSPIConfig) |
| Configures a particular DSPI instance with general settings on how it is to be used. | |
| uint8_t | u8fnConfigDSPIPreset (const DSPIPresetConfig_t *tDSPIConfig) |
| This routine will configure a particular preset configuration within an SPI instance. | |
| uint8_t | u8fnIsDSPIBusy (uint8_t u8Instance) |
| returns DSPI_BUSY_WITH_PREVIOUS_TX based on the state of HW bit SPI HALT | |
| uint32_t | u32fnFormatDSPIPUSHR (uint8_t u8DSPIInstanceWCTAR, uint8_t u8CS, uint8_t u8ContCS, uint8_t u8EndOfQueueFlag, uint16_t u16Msg) |
| Formats a 16-bit word for placement in PUSHR and transmission. | |
| uint8_t | u8fnDSPISwitchIsrMode (uint8_t u8DSPIInstanceWCTAR, uint8_t u8IsrMode) |
| Switches between Interrupt-enabled SPI and DMA-enabled SPI. | |
| void | vfnDSPI0FUFISR (void) |
| DSPI0's interrupt vector for the FUF flag. It calls a generic routine. | |
| void | vfnDSPI1FUFISR (void) |
| DSPI1's interrupt vector for the FUF flag. It calls a generic routine. | |
| void | vfnDSPI2FUFISR (void) |
| DSPI2's interrupt vector for the FUF flag. It calls a generic routine. | |
| void | vfnDSPI3FUFISR (void) |
| DSPI3's interrupt vector for the FUF flag. It calls a generic routine. | |
| void | vfnDSPI0TCFIsr (void) |
| DSPI0's interrupt vector for the Transmission Complete flag. It calls a generic routine. | |
| void | vfnDSPI1TCFIsr (void) |
| DSPI1's interrupt vector for the Transmission Complete flag. It calls a generic routine. | |
| void | vfnDSPI2TCFIsr (void) |
| DSPI2's interrupt vector for the Transmission Complete flag. It calls a generic routine. | |
| void | vfnDSPI3TCFIsr (void) |
| DSPI3's interrupt vector for the Transmission Complete flag. It calls a generic routine. | |
| void | vfnDSPI0RFDFIsr (void) |
| DSPI0's interrupt vector for the RFDF flag. It calls a generic routine. | |
| void | vfnDSPI1RFDFIsr (void) |
| DSPI1's interrupt vector for the RFDF flag. It calls a generic routine. | |
| void | vfnDSPI2RFDFIsr (void) |
| DSPI2's interrupt vector for the RFDF flag. It calls a generic routine. | |
| void | vfnDSPI3RFDFIsr (void) |
| DSPI3's interrupt vector for the RFDF flag. It calls a generic routine. | |
| void | vfnDSPI0EOQIsr (void) |
| DSPI0's interrupt vector for the End-ofQue flag. It calls a generic routine. | |
| void | vfnDSPI1EOQIsr (void) |
| DSPI1's interrupt vector for the End-ofQue flag. It calls a generic routine. | |
| void | vfnDSPI2EOQIsr (void) |
| DSPI2's interrupt vector for the End-ofQue flag. It calls a generic routine. | |
| void | vfnDSPI3EOQIsr (void) |
| DSPI3's interrupt vector for the End-ofQue flag. It calls a generic routine. | |
| void | vfnDSPI0TFFFIsr (void) |
| DSPI0's interrupt vector for the TFFF flag. It calls a generic routine. | |
| void | vfnDSPI1TFFFIsr (void) |
| DSPI1's interrupt vector for the TFFF flag. It calls a generic routine. | |
| void | vfnDSPI2TFFFIsr (void) |
| DSPI2's interrupt vector for the TFFF flag. It calls a generic routine. | |
| void | vfnDSPI3TFFFIsr (void) |
| DSPI3's interrupt vector for the TFFF flag. It calls a generic routine. | |
Variables | |
| const uint8_t | cau8DSPIInstances [N_DSPI_INSTANCES *N_DSPI_PRESETS] |
| const DSPI_t | catDSPIInstances [N_DSPI_INSTANCES] |
| vuint8_t | gau8DSPIBuffSize [N_DSPI_INSTANCES] |
| vuint8_t | gau8DSPIWordsRx [N_DSPI_INSTANCES] |
| vuint8_t | gau8DSPITransferSize [N_DSPI_INSTANCES] |
| vuint8_t | gau8DSPITxFIFOIsEnabled [N_DSPI_INSTANCES] |
| vuint8_t | gau8DSPIRxFIFOIsEnabled [N_DSPI_INSTANCES] |
| vuint16_t * | gpu16DSPITxBuffer [N_DSPI_INSTANCES] |
| vuint16_t * | gpu16DSPIRxBuffer [N_DSPI_INSTANCES] |
| vuint8_t * | gpu8DSPITxBuffer [N_DSPI_INSTANCES] |
| vuint8_t * | gpu8DSPIRxBuffer [N_DSPI_INSTANCES] |
Serial Peripheral Interface drivers.
Copyright (c) 2011 Freescale Semiconductor Freescale Confidential Proprietary
History:
| uint32_t u32fnDSPIStatus | ( | uint8_t | u8Instance | ) |
This routine returns the status register for a given instance.
| u8MyInstance,: | 8-bit word with the correct instance (0 - 3 for Pictus). |
| uint32_t u32fnFormatDSPIPUSHR | ( | uint8_t | u8DSPIInstance, |
| uint8_t | u8CS, | ||
| uint8_t | u8ContCS, | ||
| uint8_t | u8EndOfQueueFlag, | ||
| uint16_t | u16Msg | ||
| ) |
Formats a 16-bit word for placement in PUSHR and transmission.
| u8DSPIInstance,: | A combination of SPI instance and CTAR. Only CTAR is used. |
| u8CS,: | Mask to the active chip select. |
| u8ContCS,: | 1 if chip select should be continuous with next word, 0 otherwise. |
| u8EndOfQueueFlag,: | 1 if the EndOfQueue should be set at the end of the transmission, possibly generating and EOQ interrupt, 0 otherwise. |
| u16Msg,: | the 16-bit word to be added to the register. |
| uint8_t u8fnConfigDSPIGeneral | ( | const DSPIConfig_t * | tDSPIConfig | ) |
Configures a particular DSPI instance with general settings on how it is to be used.
| tDSPIConfig,: | Structure with Instance and configuration to be used. |
| uint8_t u8fnConfigDSPIPreset | ( | const DSPIPresetConfig_t * | tDSPIConfig | ) |
This routine will configure a particular preset configuration within an SPI instance.
| tDSPIConfig,: | Pointer to a structure containing the preset config. |
| uint8_t u8fnDSPISwitchIsrMode | ( | uint8_t | u8DSPIInstance, |
| uint8_t | u8IsrMode | ||
| ) |
Switches between Interrupt-enabled SPI and DMA-enabled SPI.
| u8DSPIInstance,: | 0 - 3, depending on which SPI instance will be used. |
| u8IsrMode,: | DSPI_ENABLE_DMA_DISABLE_ISR or DSPI_DISABLE_DMA_ENABLE_ISR |
| uint8_t u8fnDSPITranscieve | ( | const uint8_t | u8MyInstance, |
| const uint8_t | u8CSEnable, | ||
| uint16_t * | pu16DSPITx, | ||
| uint16_t * | pu16DSPIRx, | ||
| const uint8_t | u8Size | ||
| ) |
This routine will, once the corresponding DSPI instance has been configured, send and receive any number of words through interrupts. Note that this means that at the exit of this routine, the message might still be ongoing.
| u8MyInstance,: | 8-bit word containing both the DSPI instance and the preset configuration to be used, using the format defined in DSPIInstance_t. |
| u8CSEnable,: | Selects which Chip Select will be used. Bit dependant: BIT0 = CS0, BIT1 = CS1 and so on... |
| pu16DSPITx,: | Pointer to Buffer to be transmitted. Note that buffers containing 8-bit words will be handled accordingly, but must be cast explicitly to 16-bit pointers to call the routine. |
| pu16DSPIRx,: | Pointer to buffer where data will be received. Note that buffers containing 8-bit words will be handled accordingly, but must be cast explicitly to 16-bit pointers to call the routine |
| u8Size,: | Size of buffer to be transmitted. |
| uint8_t u8fnIsDSPIBusy | ( | uint8_t | u8Instance | ) |
returns DSPI_BUSY_WITH_PREVIOUS_TX based on the state of HW bit SPI HALT
| u8Instance,: | 0 - 3, depending on which SPI instance will be used. |
| void vfnDSPI0EOQIsr | ( | void | ) |
DSPI0's interrupt vector for the End-ofQue flag. It calls a generic routine.
| void. |
| void vfnDSPI0FUFISR | ( | void | ) |
DSPI0's interrupt vector for the FUF flag. It calls a generic routine.
| void. |
| void vfnDSPI0RFDFIsr | ( | void | ) |
DSPI0's interrupt vector for the RFDF flag. It calls a generic routine.
| void. |
| void vfnDSPI0TCFIsr | ( | void | ) |
DSPI0's interrupt vector for the Transmission Complete flag. It calls a generic routine.
| void. |
| void vfnDSPI0TFFFIsr | ( | void | ) |
DSPI0's interrupt vector for the TFFF flag. It calls a generic routine.
| void. |
| void vfnDSPI1EOQIsr | ( | void | ) |
DSPI1's interrupt vector for the End-ofQue flag. It calls a generic routine.
| void. |
| void vfnDSPI1FUFISR | ( | void | ) |
DSPI1's interrupt vector for the FUF flag. It calls a generic routine.
| void. |
| void vfnDSPI1RFDFIsr | ( | void | ) |
DSPI1's interrupt vector for the RFDF flag. It calls a generic routine.
| void. |
| void vfnDSPI1TCFIsr | ( | void | ) |
DSPI1's interrupt vector for the Transmission Complete flag. It calls a generic routine.
| void. |
| void vfnDSPI1TFFFIsr | ( | void | ) |
DSPI1's interrupt vector for the TFFF flag. It calls a generic routine.
| void. |
| void vfnDSPI2EOQIsr | ( | void | ) |
DSPI2's interrupt vector for the End-ofQue flag. It calls a generic routine.
| void. |
| void vfnDSPI2FUFISR | ( | void | ) |
DSPI2's interrupt vector for the FUF flag. It calls a generic routine.
| void. |
| void vfnDSPI2RFDFIsr | ( | void | ) |
DSPI2's interrupt vector for the RFDF flag. It calls a generic routine.
| void. |
| void vfnDSPI2TCFIsr | ( | void | ) |
DSPI2's interrupt vector for the Transmission Complete flag. It calls a generic routine.
| void. |
| void vfnDSPI2TFFFIsr | ( | void | ) |
DSPI2's interrupt vector for the TFFF flag. It calls a generic routine.
| void. |
| void vfnDSPI3EOQIsr | ( | void | ) |
DSPI3's interrupt vector for the End-ofQue flag. It calls a generic routine.
| void. |
| void vfnDSPI3FUFISR | ( | void | ) |
DSPI3's interrupt vector for the FUF flag. It calls a generic routine.
| void. |
| void vfnDSPI3RFDFIsr | ( | void | ) |
DSPI3's interrupt vector for the RFDF flag. It calls a generic routine.
| void. |
| void vfnDSPI3TCFIsr | ( | void | ) |
DSPI3's interrupt vector for the Transmission Complete flag. It calls a generic routine.
| void. |
| void vfnDSPI3TFFFIsr | ( | void | ) |
DSPI3's interrupt vector for the TFFF flag. It calls a generic routine.
| void. |
| void vfnDSPIEnable | ( | const DSPIInstance_t | tMyInstance, |
| const uint8_t | u8CSEnable, | ||
| const uint8_t | u8Start | ||
| ) |
Enables or disables a particular DSPI transmission. used by u8fnDSPITranscieve.
| tMyInstance,: | Structure with Instance and configuration to be used. |
| u8CSEnable,: | Selects which Chip Select will be used. Bit dependant: BIT0 = CS0, BIT1 = CS1 and so on... |
| u8Start,: | Enables the transmission/reception if non-zero, otherwise disables it. |
| const DSPI_t catDSPIInstances[N_DSPI_INSTANCES] |
{
&DSPI_0, &DSPI_1, &DSPI_2, &DSPI_3 }
List of pointers to each instance initial memory location
| const uint8_t cau8DSPIInstances[N_DSPI_INSTANCES *N_DSPI_PRESETS] |
{
DSPI0C0, DSPI0C1, DSPI0C2, DSPI0C3, DSPI0C4, DSPI0C5, DSPI0C6, DSPI0C7,
DSPI1C0, DSPI1C1, DSPI1C2, DSPI1C3, DSPI1C4, DSPI1C5, DSPI1C6, DSPI1C7,
DSPI2C0, DSPI2C1, DSPI2C2, DSPI2C3, DSPI2C4, DSPI2C5, DSPI2C6, DSPI2C7,
DSPI3C0, DSPI3C1, DSPI3C2, DSPI3C3, DSPI3C4, DSPI3C5, DSPI3C6, DSPI3C7 }
List of all instances and preset configurations available
| vuint8_t gau8DSPIBuffSize[N_DSPI_INSTANCES] |
Size of buffer to transmit (per instance)
| vuint8_t gau8DSPIRxFIFOIsEnabled[N_DSPI_INSTANCES] |
Flag to determine if DSPI's hardware FIFO is being used or not (Rx)
| vuint8_t gau8DSPITransferSize[N_DSPI_INSTANCES] |
Size of word to transmit per instance (16 or 8-bit)
| vuint8_t gau8DSPITxFIFOIsEnabled[N_DSPI_INSTANCES] |
Flag to determine if DSPI's hardware FIFO is being used or not (Tx)
| vuint8_t gau8DSPIWordsRx[N_DSPI_INSTANCES] |
Number of words received (per instance)
| vuint16_t* gpu16DSPIRxBuffer[N_DSPI_INSTANCES] |
Globals for 16-bit transfers (Rx)
| vuint16_t* gpu16DSPITxBuffer[N_DSPI_INSTANCES] |
Globals for 16-bit transfers (Tx)
| vuint8_t* gpu8DSPIRxBuffer[N_DSPI_INSTANCES] |
Globals for 8-bit transfers (Rx)
| vuint8_t* gpu8DSPITxBuffer[N_DSPI_INSTANCES] |
Globals for 8-bit transfers (Tx)